{{template "header"}}
<title>文章修改——我的11go_http</title>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
    {{template "nav" .}}
    <div class="container">
        <h1>修改文章</h1>
        <form action="/topic" method="post" enctype="multipart/form-data">

            <input type="hidden" name="tid"  value="{{.Tid}}">
            <div class="form-group">
                <label >  文章标题</label>
                <input type="text" name="title"  class="form-control" {{if .Topicinfo}} value="{{.Topicinfo.Title}}" {{end}}>

                <div class="form-group">
                    <label > 文章分类：</label>

                    <input type="text" class="form-control"  name="category" value="{{.Topicinfo.Category}}">
                </div>


                <div class="form-group">
                    <label > 文章标签：</label>

                    <input type="text" class="form-control"  name="label" value="{{.Topicinfo.Labels}}">
                </div>
                <div class="form-group">
                    <label >  文章内容</label>
                    <textarea name="content" cols="30"  role="10" class="form-control" >{{if .Topicinfo}} {{.Topicinfo.Content}} {{end}}</textarea>

                </div>

                    <div class="form-group">
                        <label for="fujian">文章附件(<a href="/attachment/{{.Topicinfo.Attachment}}">{{.Topicinfo.Attachment}}</a>)</label>
                        <input type="file" name="fujian" class="form-control" id="">
                    </div>


                <input type="submit" value="确定修改">

            </div>
        </form>


    </div>


    <script type ="text/javascript">
        function addCate() {
            var catename = document.getElementById("catename");
            if (catename.value.length ==0){
                alert("请输入分类名称")
                return false
            }

            var pwd = document.getElementById("pwd");
            if(pwd.value.length ==0){
                alert("请输入棉麻")
                return false
            }
            return true

        }

        function backHome() {
            window.location.href="/"
            return false
        }
    </script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="/static/plugin/bootstrap/dist/js/bootstrap.js"></script>

</nav></body>
</html>
